package com.bootdo.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.system.dao.ScanRecordMapper;
import com.bootdo.system.domain.ScanRecord;
import com.bootdo.system.service.ScanRecordService;
import com.github.pagehelper.PageHelper;

@Service("scanRecordService")
public class ScanRecordServiceImpl implements ScanRecordService{

	@Autowired
	private  ScanRecordMapper mapper;
	
	@Override
	public ScanRecord get(Long id) {
		return mapper.get(id);
	}

	@Override
	public List<ScanRecord> list(Map<String, Object> map) {
		PageHelper.startPage(Integer.parseInt(map.get("pageNum").toString()),Integer.parseInt(map.get("pageSize").toString()));
		return mapper.list(map);
	}

	@Override
	public int count(Map<String, Object> map) {
		return mapper.count(map);
	}

	@Override
	public int getTotalByCustomerId(Long customerId) {
		return mapper.getTotalByCustomerId(customerId);
	}

	@Override
	public List<ScanRecord> countList(Map<String, Object> map) {
		PageHelper.startPage(Integer.parseInt(map.get("pageNum").toString()),Integer.parseInt(map.get("pageSize").toString()));
		return mapper.countList(map);
	}

	@Override
	public int save(ScanRecord scanRecord) {
		return mapper.save(scanRecord);
	}

}
